class Solution {
public:
    int countPoints(string s) {
        int n = s.size();
        int f[20][5] = { 0 };
        for (int i = 0; i < n; i += 2) {
            int x = s[i + 1] - '0';
            cout << "x==" << x << endl;
            if (!f[x][1] && s[i] == 'R')f[x][1] = 1;
            else if (!f[x][2] && s[i] == 'G')f[x][2] = 1;
            else if (!f[x][3] && s[i] == 'B')f[x][3] = 1;
        }
        int ans = 0;
        for (int i = 0; i < 10; i++) {
            bool f1 = 0;
            for (int j = 1; j <= 3; j++) {
                if (!f[i][j]) {
                    f1 = 1;
                    break;
                }
            }
            if (!f1)ans++;
        }
        return ans;
    }
};